﻿@model PInitiatives.ViewModels.CategoryDetailsViewModel

@{
    ViewBag.Title = "Nowa kategoria";
}

<h2>Dodaj nową kategorię</h2>

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>

@using (Html.BeginForm()) {
    @Html.ValidationSummary(true)
    <fieldset>
        <legend>Category</legend>

        <div class="editor-label">
            @Html.LabelFor(model => model.Name)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Name)
            @Html.ValidationMessageFor(model => model.Name)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Parent)
        </div>
        <div class="editor-field">
            @Html.DropDownList("Parent")
            @Html.ValidationMessageFor(model => model.Parent)
        </div>

@*        <div class="editor-label">
            @Html.LabelFor(model => model.Left)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Left)
            @Html.ValidationMessageFor(model => model.Left)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Right)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Right)
            @Html.ValidationMessageFor(model => model.Right)
        </div>*@

        <p>
            <input type="submit" value="Create" name="Dodaj kategorię" />
        </p>
    </fieldset>
}

<div>
    @Html.ActionLink("Powrót do listy kategorii", "Index")
</div>
